package com.zl.controller;

import com.zl.model.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Component
public class UserBeans {

    @Bean(name = "user_user1")//方法注解
    public User setUser1(){
        User user=new User();
        user.setId(1);
        user.setName("UserBeans张三");
        user.setAge(16);
        return user;

    }
    @Bean(name = "user_user2")
    public User setUser2(){
        User user=new User();
        user.setId(2);
        user.setName("UserBeans王五");
        user.setAge(16);
        return user;

    }
}
